info():
    title: Example Game
    author: HERITAGE
    license: CC0

/* List of custom variables */
/* This is mostly intended for power users, most simple games won't need these */
var(got_text_message,0)
var(can_go_home,0)
var(door_bell_rang,0)
var(said_goodbye_friend,0)
var(friend_house_access,0)
var(ready_for_phone,0)

/* List of items */
/* Items which are not defined here, but in rooms, will act in a very standard way */
item(chair):
    on_examine: It's a simple desk chair.
    on_sit_on: I don't feel like sitting down...

item(desk):
    on_examine: It is covered in Linux Live CD's, random hardware and a Julian Assange novel.

item(paper):
    on_examine: It's a blank piece of paper.
    allow_take: true

item(posters):
    on_examine: You see two posters, one for Battle of Britain Memorial, the other for Cloudkicker. Nice music.

item(pen):
    on_examine: It's a cheap knock-off brand, but it still writes well enough.
    allow_take: true

item(computer.1):
    on_examine: It must be ancient by now.
    on_use: It appears to not boot correctly. Maybe installing Gentoo wasn't such a good idea after all.

item(monitor):
    on_examine: ERROR: Could not find /dev/mapper/root.

item(door):
    on_examine: It's just a door, nothing special.

item(note):
    on_examine: Mom, dad, I'm your daughter. None of this is your fault, and I don't want you to be angry or sad. I'll be staying over with a friend for a bit. I love you.

item(computer.2):
    on_use: This is mom's computer, I really shouldn't use it.

item(couch):
    on_examine: It's an old couch.
    on_sit_on: I don't feel like sitting down...

item(tv):
    on_examine: It's a normal TV, not too young, not too old.
    on_turn_on: Why should I bother turning it on? There's never anything on anyway.

item(doorbell):
    on_examine: It looks antique.
    on_ring: $(equals:door_bell_rang,0;You ring the doorbell and your friend opens the door. 'Come in', she says, before walking to the living room.#(door_bell_rang=1)#|There is no need to ring the doorbell again.)$

item(friend.1):
    on_examine: She smiles at you.
    on_talk_to: "Have you told them yet?", she asks you.
    on_say_yes_to: She smiles at you.
                   "You're worried, aren't you? Don't worry, hun, I'm sure it'll be fine", she says, pausing for a bit.
                   "Let's go upstairs, play some games?", she asks invitingly, leaving the room before you can answer.
                   #(friend_house_access=1)#

action(say_yes):
    succeed: She smiles at you.
                   "You're worried, aren't you? Don't worry, hun, I'm sure it'll be fine", she says, pausing for a bit.
                   "Let's go upstairs, play some games?", she asks invitingly, leaving the room before you can answer.
                   #(friend_house_access=1)#
    require_here: friend.1

item(friend.2):
    on_examine: She smiles at you.
    on_say_goodbye_to: "Bye, hun! Take care!" #(said_goodbye_friend=1)#

action(say_goodbye):
    succeed: "Bye, hun! Take care!" #(said_goodbye_friend=1)#
    require_here: friend.2

item(computer.3):
    on_examine: It looks pretty fancy.

/* Actions are what has been classicly regarded to as verbs. You define a specific action, the requirements and the result */
action(write_note|use_pen):
    succeed: You take a deep breath and start writing down your feelings on the piece of paper, creating a note for your parents.
    require_inventory: paper, pen
    lose: paper
    gain: note

action(put_note_on_table|leave_note|drop_note|put_down_note):
    succeed: You put the note on the table.
    require_inventory: note
    require_here: table
    drop: note

action(read_text_message|read_message|read_messages|check_phone|check_message|check_messages):
    succeed: Mom: Please come home #(can_go_home=1)#
    fail: I don't have any unread messages
    equals: ready_for_phone, 1

/* Sometimes, exits need to be treated in a special way. For example, an exit leading to a non-standard location, or an exit that can't be left without a special item such as a key */
exit(1):
    fail: I can't leave the house yet. Despite my fear, I should really tell my parents who I truly am. Perhaps I could leave them a note...
    require_location: 0.0.-1, note
    new_location: 10.0.-1

exit(2):
    fail: I don't want to go back home...
    equals: can_go_home,1
    new_location: 999.999.999

exit(3):
    fail: The door is locked.
    equals: door_bell_rang,1

exit(4):
    fail: It's rude to leave without saying goodbye.
    equals: said_goodbye_friend,1

exit(5):
    fail: I can't just go to her bedroom, show a little respect!
    equals: friend_house_access,1

/* A list of rooms, where the player will be hanging around */

var(name, "");

room(0.0.0):
    /* Your room */
    first_enter: What is your name? #(_write_to=name)#
    description: You are in !(name)!'s room.

                 It is a rather bland room, containing only a desk, a chair and some posters.

                 On the desk $(require_here:paper;lies an empty piece of paper and )$stands a computer, the monitor displaying a cryptic error message.

                 There is a door to the north.
    items: chair, desk, paper, computer|pc.1, monitor, door, posters
    exits: north

room(0.1.0):
    /* Second-floor hallway */
    description: You are in the hallway on the second floor.

                 There is a stair leading downstairs, a door to the south which leads to your room and a door to the west which leads to your mother's office.
    exits: west, down|downstairs, south

room(-1.1.0):
    /* Mom's office */
    description: You are in your mother's office$(require_here:pen;, a pen lying on her office)$.

                 There is a door to the east, leading to a hallway.
    items: pen, computer.2
    exits: east

room(0.1.-1):
    /* Hallway downstairs */
    description: You are in the hallway downstairs.

                 A door to the north leads outside, a door to the south leads to the living room.

                 There are also stairs leading upstairs.
    exits: north.1, south, up|upstairs

room(0.0.-1):
    /* Living room */
    description: You are in the living room, which contains a couch, a table and a tv.

                 $(require_here:note;On the table lies an emotional note to your parents.
                 )$
                 A door to the north leads to the hallway.
    items: couch, table, tv
    exits: north

room(10.0.-1):
    /* Friend's home, front door */
    first_enter: You ride your bike towards your friends home, arriving a good fifteen minutes later...
    description: You are standing in front of your friend's home.

                 The garden is fairly boring, but the door is a beautiful wooden door, a small doorbell next to it.
    
                 North of you is a wooden door, to the south is the route back home.
    items: doorbell
    exits: south.2, north.3

room(10.1.-1):
    /* Friend's home, hallway */
    description: You are in the hallway of your friend's home.

                 To the north is the living room, upstairs is your friend's bedroom, to the south is the front door.
    exits: north, up|upstairs.5, south.4

room(10.2.-1):
    /* Friend's home, living room */
    description: You are in your friend's living room.

                 $(require_here:friend.1;Your friend is sitting on the couch, looking at you.)$$(!require_here:friend.1;The couch is empty.)$

                 There is an exit south, leading to the hallway.
    items: $(equals:friend_house_access,0;friend.1)$
    exits: south

room(10.1.0):
    /* Friend's bedroom */
    first_enter: Upon entering your friend's bedroom, she shows you her favourite game.

                 You play for a good hour, until your phone notifies you of a new message...
                 #(ready_for_phone=1)#
    description: You are in your friend's bedroom. She is playing some games. Your friend's hallway is downstairs.
    items: friend.2, computer.3
    exits: down|downstairs

room(999.999.999):
    /* Game ends */
    first_enter: Our story ends here, without any conclusion.

                 Whatever your story is, you can make it great, as long as you believe in yourself.

                 Goodbye, for now, and thanks for playing.
                 #(_game_over=1)#
